local jiqiao = fk.CreateSkill {
  name = "wk_heg__jiqiao",
}

Fk:loadTranslationTable{
  ["wk_heg__jiqiao"] = "激峭",
  [":wk_heg__jiqiao"] = "当你使用牌时，你可摸一张牌，此牌结算后若未造成过伤害，你弃置两张牌。",

  ["$wk_heg__jiqiao1"] = "为将者，当躬冒矢石！",
  ["$wk_heg__jiqiao2"] = "吾承父兄之志，危又何惧？",
}

jiqiao:addEffect(fk.CardUsing, {
  anim_type = "special",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(jiqiao.name) and player == target
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(1, jiqiao.name)
    data.extra_data = data.extra_data or {}
    data.extra_data.wk_heg__jiqiaoUser = player.id
  end,
})

jiqiao:addEffect(fk.CardUseFinished, {
  anim_type = "special",
  is_delay_effect = true,
  can_trigger = function(self, event, target, player, data)
    return ((data.extra_data or {}).wk_heg__jiqiaoUser == player.id) and not data.damageDealt and not player.dead
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    player.room:askToDiscard(player, {
      min_num = 2,
      max_num = 2,
      include_equip = true,
      skill_name = jiqiao.name,
      cancelable = false,
    })
  end,
})

return jiqiao